import styled from "styled-components";

export const ItemWrapper = styled.div`
  width: ${props => props.itemWidth};
  padding: 8px;
  box-sizing: border-box;
  flex-shrink: 0;

  .inner {
    width: 100%;
    cursor: pointer;


    .swiper {
      position: relative;
      .control {
        display: none;
      }
      &:hover {
        .control {
          display: block;
        .left, .right {
          position: absolute;
          width: 70px;
          height: 100%;
          color: white;
          z-index: 1;
          display: flex;
          align-items: center;
          justify-content: center;
          font-weight: 700;
          font-size: 26px;
        }
        .left {
          left: 0;
          background: linear-gradient(90deg, rgba(0, 0, 0, .3), transparent);
        }
        .right {
          right: 0;
          background: linear-gradient(270deg, rgba(0, 0, 0, .3), transparent);
        }
      }
      }

      .indicator {
        position: absolute;
        bottom: 10px;
        z-index: 9;
        width: 24%;
        left: 50%;
        transform: translateX(-50%);
        overflow: hidden;
        .dot {
          width: 6px;
          height: 6px;
          border-radius: 50%;
          margin: 3px;
          background-color: rgba(255, 255, 255, .7);
          &.active {
            width: 8px;
            height: 8px;
            background-color: white;
          }
        }
      }
    }
  }

  .img-cover {
    position: relative;
    padding: 66.6% 8px 0;
    border-radius: 3px;
    overflow: hidden;
    img {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }
  .desc {
    margin: 10px 0 5px;
    font-size: 12px;
    font-weight: 700;
    color: ${props => props.verifycolor};
  }
  .price {
    margin: 8px 0;
  }
  .name {
    font-size: 16px;
    font-weight: 700;
    line-height: 26px;

    overflow: hidden;  
    text-overflow: ellipsis; 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
  }
  .bottom {
    .rate {
      color: #00848A;
      font-size: 12px;
      li {
        margin-right: -1px;
      }
    }
    .count {
      margin: 0 2px 0 4px;
    }
  }
`